/**
 *店铺列表展开
 *@Author: zfx
 @Data: 2018-07-05 14:00:55
 */
<style lang="less" rel="stylesheet/less" type="text/less" scoped>
    .expanded-cell-h3 {
        padding-bottom: 5px;
    }
    .expand-row {
        margin-bottom: 10px;
        .expand-center {
            text-align: center;
        }
    }
</style>
<template>
	<div
		v-if="row.length !== 0">
		<h3 class="expanded-cell-h3">{{ $t('store.admin_information') }}：</h3>
		<Row
			v-for="(item, key) in row"
			:key="key"
			class="expand-row">
			<i-col span="5">
				<span class="expand-key">{{ $t('store.admin_account') }}：</span>
				<a
					v-if="item.account"
					href="javascript:void(0);"
					class="expand-value"
					@click="accessStore(item.account, item.id, is_deleted)">
					{{ item.account }}
				</a>
				<a
					v-else
					class="expand-value"
					@click="accessStore(item.account)">
					{{ $t('store.unno') }}
				</a>
			</i-col>
			<i-col span="5">
				<span class="expand-key">{{ $t('store.admin_name') }}：</span>
				<span
					class="expand-value">{{ item.name || $t('store.unno') }}</span>
			</i-col>
			<i-col span="5">
				<span class="expand-key">{{ $t('store.admin_email') }}：</span>
				<span
					class="expand-value">{{ item.email || $t('store.unno') }}</span>
			</i-col>
			<i-col span="3">
				<span class="expand-key">{{ $t('store.admin_phone') }}：</span>
				<span
					class="expand-value">{{ item.phone || $t('store.unno') }}</span>
			</i-col>
			<i-col span="3">
				<span class="expand-key">{{ $t('store.admin_sex') }}：</span>
				<span class="expand-value">{{ item.sex ? $t('store.sex_woman') : $t('store.sex_man') }}</span>
			</i-col>
			<i-col span="3">
				<span class="expand-key">{{ $t('store.admin_deleted') }}：</span>
				<span class="expand-value">{{ account_status[Number(item.is_deleted)] }}</span>
			</i-col>
		</Row>
	</div>
	<div
		v-else>
		<Row
			class="expand-row">
			<i-col
				class="expand-row">
				<span class="expand-key">{{ $t('store.no_relevant_accound_information') }}</span>
			</i-col>
		</Row>
	</div>
</template>

<script>
export default {
	name: 'CustomerStoreExpandRow',
	props: {
		row: {
			type: Array,
			default() {
				return {};
			},
		},
		accessStore: {
			type: Function,
			required: true,
		},
		is_deleted: {
			type: Boolean,
			required: true,
		},
	},
	data() {
		return {
			account_status: {
				0: this.$t('store.enable'), // 禁用
				1: this.$t('store.disable'), // 启用
			},
		};
	},
};
</script>

